<%--
  Created by IntelliJ IDEA.
  User: 13585
  Date: 2020/12/23
  Time: 8:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="top.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>login</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/index.css" rel="stylesheet">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="js/jquery-3.2.1.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="js/bootstrap.min.js"></script>
    <style>
        body{
            background: url("images/login.jpg") no-repeat;
            background-size: cover;
        }
    </style>
</head>
<body>
<div id="login">
    <form class="form-horizontal" action="login" method="post">
        <img id="logoid" src="${pageContext.request.getContextPath()}/images/login.png" height="35">
        <span class="msg col-sm-offset-3">${msg}</span>
        <div class="form-group">
            <label for="username" class="col-sm-3 control-label">账号:</label>
            <div class="col-sm-9">
                <input type="number" name="username" class="form-control" id="username" placeholder="手机号">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword" class="col-sm-3 control-label">密码:</label>
            <div class="col-sm-9">
                <input type="password" name="password" class="form-control" id="inputPassword" placeholder="密码">
            </div>
        </div>
        <div class="form-group">
            <label for="code" class="col-sm-3 control-label">验证码:</label>
            <div class="col-sm-4">
                <input type="text" name="code" class="form-control" id="code" placeholder="请输入验证码">
            </div>
            <div class="col-md-5">
                <img id="codeimg" src="${pageContext.request.contextPath}/captcha">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-3 col-sm-9">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="remember"> 下一次自动登录
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-3 col-sm-9">
                <button type="submit" class="btn btn-default">登录</button>
            </div>
        </div>
    </form>
    <a class="reg" href="reg.jsp">没有账号,去注册</a>
</div>
<script>
    let img = document.getElementById("codeimg");
    img.onclick = function () {
        this.src = "${pageContext.request.contextPath}/captcha?timer="+Date.now();
    }
</script>

</body>
</html>
